



<!DOCTYPE html>
<html lang="zh" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      <meta http-equiv="x-ua-compatible" content="ie=edge">
	  <meta name="keywords" content="极简风评论系统,社会化评论系统,无后端评论系统,评论系统,comment system,valine comment system,simple &amp; fast,Minimalist style">
      
        <meta name="description" content="A fast, simple & powerful comment system.">
      
      
        <link rel="canonical" href="https://valine.js.org/avatar/">
      
      
        <meta name="author" content="xCss">
      
      
        <meta name="lang:clipboard.copy" content="复制">
      
        <meta name="lang:clipboard.copied" content="已复制">
      
        <meta name="lang:search.language" content="jp">
      
        <meta name="lang:search.pipeline.stopwords" content="True">
      
        <meta name="lang:search.pipeline.trimmer" content="True">
      
        <meta name="lang:search.result.none" content="没有找到符合条件的结果">
      
        <meta name="lang:search.result.one" content="找到 1 个符合条件的结果">
      
        <meta name="lang:search.result.other" content="# 个符合条件的结果">
      
        <meta name="lang:search.tokenizer" content="[\uff0c\u3002]+">
      
      <link rel="shortcut icon" href="../assets/images/favicon.ico">
      <meta name="generator" content="mkdocs-0.17.3, mkdocs-material-2.7.1">
    
    
      
        <title>头像设置 - Valine</title>
      
    
    
      <link rel="stylesheet" href="../assets/stylesheets/application.78aab2dc.css">
      
        <link rel="stylesheet" href="../assets/stylesheets/application-palette.6079476c.css">
      
    
    
      <script src="../assets/javascripts/modernizr.1aa3b519.js"></script>
    
    
      <link href="https://fonts-gstatic.proxy.ustclug.org" rel="preconnect" crossorigin>
      
        <link rel="stylesheet" href="https://fonts.proxy.ustclug.org/css?family=Ubuntu:300,400,400i,700|Ubuntu+Mono">
        <style>body,input{font-family:"Ubuntu","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Ubuntu Mono","Courier New",Courier,monospace}</style>
      
      <link rel="stylesheet" href="https://fonts.proxy.ustclug.org/icon?family=Material+Icons">
    
    
    
  </head>
  
    
    
    <body dir="ltr" data-md-color-primary="white" data-md-color-accent="">
  
    <svg class="md-svg">
      <defs>
        
        
          <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
    viewBox="0 0 416 448" id="github">
  <path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
        8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
        18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
        19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
        18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
        304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
        2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
        38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
        37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
        82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
        1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
        0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
        30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
        46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
        99.5z" />
</svg>
        
      </defs>
    </svg>
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="search" autocomplete="off">
    <label class="md-overlay" data-md-component="overlay" for="drawer"></label>
    
      <a href="#_1" tabindex="1" class="md-skip">
        跳转至
      </a>
    
    
      <header class="md-header" data-md-component="header">
  <nav class="md-header-nav md-grid">
    <div class="md-flex">
      <div class="md-flex__cell md-flex__cell--shrink">
        <a href="https://valine.js.org/" title="Valine" class="md-header-nav__button md-logo">
          
            <img src="../assets/images/valine.png" width="24" height="24">
          
        </a>
      </div>
      <div class="md-flex__cell md-flex__cell--shrink">
        <label class="md-icon md-icon--menu md-header-nav__button" for="drawer"></label>
      </div>
      <div class="md-flex__cell md-flex__cell--stretch">
        <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
          
            
              <span class="md-header-nav__topic">
                Valine
              </span>
              <span class="md-header-nav__topic">
                头像设置
              </span>
            
          
        </div>
      </div>
      <!-- <div class="md-flex__cell md-flex__cell--shrink">
        
          
            <label class="md-icon md-icon--search md-header-nav__button" for="search"></label>
            
<div class="md-search" data-md-component="search" role="dialog">
  <label class="md-search__overlay" for="search"></label>
  <div class="md-search__inner" role="search">
    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" name="query" placeholder="搜索" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
      <label class="md-icon md-search__icon" for="search"></label>
      <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
        &#xE5CD;
      </button>
    </form>
    <div class="md-search__output">
      <div class="md-search__scrollwrap" data-md-scrollfix>
        <div class="md-search-result" data-md-component="result">
          <div class="md-search-result__meta">
            键入以开始搜索
          </div>
          <ol class="md-search-result__list"></ol>
        </div>
      </div>
    </div>
  </div>
</div>
          
        
      </div> -->
      
        <div class="md-flex__cell md-flex__cell--shrink">
          <div class="md-header-nav__source">
            


  


  <a href="https://github.com/xCss/Valine/" title="前往 Github 仓库" class="md-source" data-md-source="github">
    
      <div class="md-source__icon">
        <svg viewBox="0 0 24 24" width="24" height="24">
          <use xlink:href="#github" width="24" height="24"></use>
        </svg>
      </div>
    
    <div class="md-source__repository">
      xCss/Valine
    </div>
  </a>

          </div>
        </div>
      
    </div>
  </nav>
</header>
    
    <div class="md-container">
      
        
      
      
        

  

<nav class="md-tabs md-tabs--active" data-md-component="tabs">
  <div class="md-tabs__inner md-grid">
    <ul class="md-tabs__list">
      
        
  <li class="md-tabs__item">
    
      <a href=".." title="首页" class="md-tabs__link">
        首页
      </a>
    
  </li>

      
        
  
  
    <li class="md-tabs__item">
      
        <a href="../quickstart/" title="定制" class="md-tabs__link md-tabs__link--active">
          定制
        </a>
      
    </li>
  

      
        
  
  
    <li class="md-tabs__item">
      
        <a href="../hexo/" title="其他" class="md-tabs__link">
          其他
        </a>
      
    </li>
  

      
    </ul>
  </div>
</nav>
      
      <main class="md-main">
        <div class="md-main__inner md-grid" data-md-component="container">
          
            
              <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    <nav class="md-nav md-nav--primary" data-md-level="0">
  <label class="md-nav__title md-nav__title--site" for="drawer">
    <span class="md-nav__button md-logo">
      
        <img src="../assets/images/valine.png" width="48" height="48">
      
    </span>
    Valine
  </label>
  
    <div class="md-nav__source">
      


  


  <a href="https://github.com/xCss/Valine/" title="前往 Github 仓库" class="md-source" data-md-source="github">
    
      <div class="md-source__icon">
        <svg viewBox="0 0 24 24" width="24" height="24">
          <use xlink:href="#github" width="24" height="24"></use>
        </svg>
      </div>
    
    <div class="md-source__repository">
      xCss/Valine
    </div>
  </a>

    </div>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
      


  <li class="md-nav__item">
    <a href=".." title="首页" class="md-nav__link">
      首页
    </a>
  </li>

    
      
      
      

  


  <li class="md-nav__item md-nav__item--active md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" checked>
    
    <label class="md-nav__link" for="nav-2">
      定制
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-2">
        定制
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../quickstart/" title="快速开始" class="md-nav__link">
      快速开始
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../configuration/" title="配置项" class="md-nav__link">
      配置项
    </a>
  </li>

        
          
          
          

  


  <li class="md-nav__item md-nav__item--active">
    
    <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="toc">
    
      
    
    
    <a href="./" title="头像设置" class="md-nav__link md-nav__link--active">
      头像设置
    </a>
    
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../notify/" title="邮件提醒" class="md-nav__link">
      邮件提醒
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../i18n/" title="多语言支持" class="md-nav__link">
      多语言支持
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
    
    <label class="md-nav__link" for="nav-3">
      其他
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-3">
        其他
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../hexo/" title="Hexo中的使用" class="md-nav__link">
      Hexo中的使用
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../cdn/" title="CDN" class="md-nav__link">
      CDN
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../faq/" title="FAQ" class="md-nav__link">
      FAQ
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../contact/" title="联系我" class="md-nav__link">
      联系我
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    
<nav class="md-nav md-nav--secondary">
  
  
    
  
  
</nav>
                  </div>
                </div>
              </div>
            
          
          <div class="md-content">
            <article class="md-content__inner md-typeset">
              
                
                  <a href="https://github.com/xCss/Valine/edit/master/docs/avatar.md" title="编辑此页" class="md-icon md-content__icon">&#xE3C9;</a>
                
                
                <h1 id="_1">头像设置<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h1>
<p>Valine 使用的是**Gravatar** 作为评论列表头像(感谢<code>gravatar.loli.net</code>提供的镜像服务)。<br />
目前有以下7种可选值:  </p>
<table>
<thead>
<tr>
<th align="center">参数值</th>
<th align="center">表现形式</th>
<th>备注</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">空字符串<code>''</code></td>
<td align="center"><img alt="Gravatar官方图形" src="https://gravatar.loli.net/avatar/adb831a7fdd83dd1e2a309ce7591dff8?s=40" /></td>
<td>Gravatar官方图形</td>
</tr>
<tr>
<td align="center"><code>mm</code></td>
<td align="center"><img alt="神秘人(一个灰白头像)" src="https://gravatar.loli.net/avatar/adb831a7fdd83dd1e2a309ce7591dff8?s=40&amp;d=mm" /></td>
<td>神秘人(一个灰白头像)</td>
</tr>
<tr>
<td align="center"><code>identicon</code></td>
<td align="center"><img alt="抽象几何图形" src="https://gravatar.loli.net/avatar/adb831a7fdd83dd1e2a309ce7591dff8?s=40&amp;d=identicon" /></td>
<td>抽象几何图形(根据邮箱或昵称生成)</td>
</tr>
<tr>
<td align="center"><code>monsterid</code></td>
<td align="center"><img alt="小怪物" src="https://gravatar.loli.net/avatar/adb831a7fdd83dd1e2a309ce7591dff8?s=40&amp;d=monsterid" /></td>
<td>小怪物</td>
</tr>
<tr>
<td align="center"><code>wavatar</code></td>
<td align="center"><img alt="用不同面孔和背景组合生成的头像" src="https://gravatar.loli.net/avatar/adb831a7fdd83dd1e2a309ce7591dff8?s=40&amp;d=wavatar" /></td>
<td>用不同面孔和背景组合生成的头像(根据邮箱或昵称生成)</td>
</tr>
<tr>
<td align="center"><code>retro</code></td>
<td align="center"><img alt="八位像素复古头像" src="https://gravatar.loli.net/avatar/adb831a7fdd83dd1e2a309ce7591dff8?s=40&amp;d=retro" /></td>
<td>八位像素复古头像(根据邮箱或昵称生成)</td>
</tr>
<tr>
<td align="center"><code>hide</code></td>
<td align="center">&nbsp;</td>
<td>不显示头像</td>
</tr>
</tbody>
</table>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p>参数值<code>hide</code>在版本<code>v1.1.8-beta</code>开始支持。</p>
<p>如果参数<code>avatar</code>的值不等于列表中的任意一种，则默认为<code>mm</code>。</p>
</div>
<div class="codehilite"><pre><span></span><span class="k">new</span> <span class="nx">Valine</span><span class="p">({</span>
    <span class="p">...</span>
    <span class="nx">avatar</span><span class="o">:</span><span class="s1">&#39;&#39;</span> <span class="c1">// (&#39;&#39;/mm/identicon/monsterid/wavatar/retro/hide)</span>
<span class="p">});</span>
</pre></div>
                
                  
                
              
              
                
	<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
	<script src="//unpkg.com/valine@latest/dist/Valine.min.js"></script>

  <h2 id="comments">评论</h2>
  <div id="valine_thread"></div>
  <script>
  
        var valine = new Valine();
        valine.init({
            el: '#valine_thread',
            appId: '3GiiCyXCrGbOIH3EelCfJ6yw-gzGzoHsz',
            appKey: 'iuneD4hXPQImdHQSRE0aOcRF',
			notify:true,
            placeholder: 'ヾﾉ≧∀≦)o来啊，快活啊!',
            avatar:'mm' // 1.1.7 新增(mm/identicon/monsterid/wavatar/retro)
        })

  </script>
              
            </article>
          </div>
        </div>
      </main>
      
        
<footer class="md-footer">
  
    <div class="md-footer-nav">
      <nav class="md-footer-nav__inner md-grid">
        
          <a href="../configuration/" title="配置项" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
            </div>
            <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  后退
                </span>
                配置项
              </span>
            </div>
          </a>
        
        
          <a href="../notify/" title="邮件提醒" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
            <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  前进
                </span>
                邮件提醒
              </span>
            </div>
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
            </div>
          </a>
        
      </nav>
    </div>
  
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <div class="md-footer-copyright">
        
          <div class="md-footer-copyright__highlight">
            Copyright &copy; 2017 - 2018 xCss
          </div>
        
        powered by
        <a href="http://www.mkdocs.org">MkDocs</a>
        and
        <a href="https://squidfunk.github.io/mkdocs-material/">
          Material for MkDocs</a>
      </div>
      
        
  <div class="md-footer-social">
    <link rel="stylesheet" href="../assets/font-awesome/css/font-awesome.min.css">
    
      <a href="https://github.com/xCss" class="md-footer-social__link fa fa-github"></a>
    
      <a href="http://weibo.com/BingPictures" class="md-footer-social__link fa fa-weibo"></a>
    
  </div>

      
    </div>
  </div>
</footer>
      
    </div>
    
      <script src="../assets/javascripts/application.8eb9be28.js"></script>
      
        
        
          
          <script src="../assets/javascripts/lunr/lunr.stemmer.support.js"></script>
          
            
              
                <script src="../assets/javascripts/lunr/tinyseg.js"></script>
              
              
                <script src="../assets/javascripts/lunr/lunr.jp.js"></script>
              
            
          
          
        
      
      <script>app.initialize({version:"0.17.3",url:{base:".."}})</script>
      
    
    
      
        <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?3a67769b7760c62aafb6fa58d51da74c";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
      
    
  </body>
</html>